<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\ListController;
use common\models\member\Member;
use common\models\category\Category;
use common\models\articles\Articles;
use common\models\art\Art;
use common\models\meeting\Meeting;
use common\models\FriendLink\FriendLink;
use common\models\LinkType\LinkType;
use common\models\Fenhuigrade\Fenhuigrade;
use common\models\Ad\AdPosition;
use common\models\Ad\Ad;

$CWA_News = Articles::find()->where(['status'=>10,'category_id'=>7])->orderBy('id desc')->asArray()->limit(6)->All();
$Industry_News = Articles::find()->where(['status'=>10,'category_id'=>8])->orderBy('id desc')->asArray()->limit(6)->All();
$Overseas_News = Articles::find()->where(['status'=>10,'category_id'=>9])->orderBy('id desc')->asArray()->limit(6)->All();
$CWA_Events = Articles::find()->where(['status'=>10,'category_id'=>11])->orderBy('id desc')->asArray()->limit(6)->All();

$CWA_News1 = Articles::find()->where(['status'=>10,'category_id'=>7])->orderBy('id desc')->one();
$Industry_News1 = Articles::find()->where(['status'=>10,'category_id'=>8])->orderBy('id desc')->one();
$Overseas_News1 = Articles::find()->where(['status'=>10,'category_id'=>9])->orderBy('id desc')->one();
$CWA_Events1 = Articles::find()->where(['status'=>10,'category_id'=>11])->orderBy('id desc')->one();

// $CWA_News1 = Category::find()->where(['id'=>7])->asArray()->one()['seo_contents'];
// $Industry_News1 = Category::find()->where(['id'=>8])->asArray()->one()['seo_contents'];
// $Overseas_News1 = Category::find()->where(['id'=>9])->asArray()->one()['seo_contents'];
// $CWA_Events1 = Category::find()->where(['id'=>12])->asArray()->one()['seo_contents'];

// $ywgg = Ad::find()->where(['position_id'=>12])->one();//要问广告
// $zcgg = Ad::find()->where(['position_id'=>13])->one();//协会政策广告
// $gggg = Ad::find()->where(['position_id'=>14])->one();//公告广告
// $ads = Ad::find()->where(['position_id'=>15])->asArray()->All();
// $hygg = Ad::find()->where(['position_id'=>19])->asArray()->All();
$links = FriendLink::find()->where(['lid'=>3])->asArray()->All();
$zlinks = FriendLink::find()->where(['lid'=>8])->asArray()->All();//专题
$splinks = FriendLink::find()->where(['lid'=>9])->one();//专题
$huiyuannew = Art::find()->where(['status'=>10])->orderBy('created_at DESC')->asArray()->limit(3)->All();

$myvideo = Articles::find()->where(['status'=>10,'category_id'=>117])->one()['content'];

?>

    <!--content-->
    <div class="content">
        <div class="w1113 bgd-ff">
            <!--块一-->
            <div class="clearFloat enwid">
                <div class="inleft">
                    <div class="inyao pt10">
                        <h3 class="inyaotitle">CWA News</h3>
                        <div class="clearFloat inbb">
                            <div class="ywimg relative floatLeft">
                                <a href="">
                                    <img src="/upload/<?= json_decode($CWA_News1['img'], true)['newname'];?>" alt="" width="266" height="240">
                                    <h3 class="ywtit"><?= substr(strip_tags($CWA_News1['intro']),0,27); ?><?php if(strlen($CWA_News1['intro']) > 27) { echo '...'; } ?></h3>
                                </a>
                            </div>
                            <div class="ywlist floatRight">
                                <ul>
                                <?php foreach($CWA_News as $yw){?>
                                    <li>
                                        <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $yw['id']]); ?>">
                                        <?= mb_substr(strip_tags($yw['title']),0,50,'utf-8'); ?><?php if(strlen($yw['title']) > 51) { echo '...'; } ?>
                                        </a>
                                    </li>
                                <?php } ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="inleft">
                    <div class="inyao pt10">
                        <h3 class="inyaotitle">Industry News</h3>
                        <div class="clearFloat inbb">
                            <div class="ywimg relative floatLeft">
                                <a href="">
                                    <img src="/upload/<?= json_decode($Industry_News1['img'], true)['newname'];?>" alt="" width="266" height="240">
                                    <h3 class="ywtit"><?= substr(strip_tags($Industry_News1['intro']),0,27); ?><?php if(strlen($Industry_News1['intro']) > 27) { echo '...'; } ?></h3>
                                </a>
                            </div>
                            <div class="ywlist floatRight">
                                <ul>
                                   <?php foreach($Industry_News as $yw){?>
                                    <li>
                                        <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $yw['id']]); ?>">
                                        <?= mb_substr(strip_tags($yw['title']),0,50,'utf-8'); ?><?php if(strlen($yw['title']) > 51) { echo '...'; } ?>
                                        </a>
                                    </li>
                                    <?php } ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="inleft">
                    <div class="inyao pt10">
                        <h3 class="inyaotitle">Overseas News</h3>
                        <div class="clearFloat inbb">
                            <div class="ywimg relative floatLeft">
                                <a href="">
                                    <img src="/upload/<?= json_decode($Overseas_News1['img'], true)['newname'];?>" alt="" width="266" height="240">
                                    <h3 class="ywtit"><?= substr(strip_tags($Overseas_News1['intro']),0,27); ?><?php if(strlen($Overseas_News1['intro']) > 27) { echo '...'; } ?></h3>
                                </a>
                            </div>
                            <div class="ywlist floatRight">
                                <ul>
                                    <?php foreach($Overseas_News as $yw){?>
                                    <li>
                                        <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $yw['id']]); ?>">
                                        <?= mb_substr(strip_tags($yw['title']),0,50,'utf-8'); ?><?php if(strlen($yw['title']) > 51) { echo '...'; } ?>
                                        </a>
                                    </li>
                                    <?php } ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="inleft">
                    <div class="inyao pt10">
                        <h3 class="inyaotitle">CWA Events</h3>
                        <div class="clearFloat inbb" style="border-bottom: none;">
                            <div class="ywimg relative floatLeft">
                                <a href="">
                                    <img src="/upload/<?= json_decode($CWA_Events1['img'], true)['newname'];?>" alt="" width="266" height="240">
                                    <h3 class="ywtit"><?= substr(strip_tags($CWA_Events1['intro']),0,27); ?><?php if(strlen($CWA_Events1['intro']) > 27) { echo '...'; } ?></h3>
                                </a>
                            </div>
                            <div class="ywlist floatRight">
                                <ul>
                                    <?php foreach($CWA_Events as $yw){?>
                                    <li>
                                        <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $yw['id']]); ?>">
                                        <?= mb_substr(strip_tags($yw['title']),0,50,'utf-8'); ?><?php if(strlen($yw['title']) > 51) { echo '...'; } ?>
                                        </a>
                                    </li>
                                    <?php } ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--块一end-->

            <!--links-->
            <div class="clearFloat ml25 mr25 linksbor">
                <div class="liksh3 floatLeft">
                    Links
                </div>
                <div class="likscont floatRight">
                    <div class="liksconta">
                        <ul class="clearFloat">
                        <?php foreach ($links as $lk){ ?>
                        <li>
                            <a href="<?=$lk['link_url']?>" target="_blank"><?=$lk['link_name']?></a>
                        </li>
                        <?php } ?>
                        </ul>

                    </div>
                </div>
            </div>
            <!--links end-->
        </div>
    </div>
    <!--content end-->